package com.iflytek.aisol.audit.iflytek.strategy.manage.mapper;

import com.iflytek.aisol.audit.iflytek.strategy.manage.entity.GrayConfig;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.Map;

@Repository
public interface GrayConfigMapper extends JpaRepository<GrayConfig, Long> {
    // 根据查询条件动态构建查询方法
    @Query("SELECT si FROM GrayConfig si WHERE (:grayName IS NULL OR si.grayName = :grayName)")
    Page<GrayConfig> findAllWithFilters(@Param("grayName") String grayName, Pageable pageable);


}
